FROM docker.io/centos:7.2.1511 
MAINTAINER "YSC" <843592242@qq.com>
ENV TZ "Asia/Shanghai"
ENV TERM xterm
# enable systemd
RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); rm -f /lib/systemd/system/multi-user.target.wants/*; rm -f /etc/systemd/system/*.wants/*;rm -f /lib/systemd/system/local-fs.target.wants/*; rm -f /lib/systemd/system/sockets.target.wants/*udev*; rm -f /lib/systemd/system/sockets.target.wants/*initctl*; rm -f /lib/systemd/system/basic.target.wants/*;rm -f /lib/systemd/system/anaconda.target.wants/*;
# install nginx php 
RUN rpm -vih http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm; yum install -y nginx openssh-server ;\
rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm; \
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm; \
yum install -y php56w-pear php56w-common php56w php56w-fpm php56w-pdo php56w-gd php56w-process php56w-cli php56w-devel php56w-xml php56w-mysqlnd php56w-mbstring php56w-pecl-redis php56w-pecl-gearman net-tools iproute; yum clean all ; systemctl enable nginx.service ; systemctl enable php-fpm.service;systemctl enable sshd.service; \
echo '1qaz@WSX3edc'| passwd --stdin root;
# add php mongodb
ADD mongodb.so /usr/lib64/php/modules/mongodb.so
ADD mongodb.ini /etc/php.d/mongodb.ini
# share dir
VOLUME [ "/sys/fs/cgroup" ]
CMD ["/usr/sbin/init"]
